<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
DeviceID   e043226933166383  "e045016077431621"
LocalID    15754498   090350675  (相同)   "15754512766510279"
ClientMsgId   15754498090350675
<button onclick="sendMsg()">发送</button>
<!--<script src="https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=wYhryCA7sA==&tip=0&r=744007686&_=1575508839121"></script>-->
<script src="js/axios.min.js"></script>
<script>
  // 需要先写入cookie
  function getDeviceID() {
    return "e" + ("" + Math.random().toFixed(15)).substring(2, 17)
  }
  function getLocalID() {
    return ((new Date()).getTime() + Math.random().toFixed(3)).replace(".", "")
  }
  /**
   * location /cgi-bin {
            proxy_pass   https://wx2.qq.com;
	    proxy_set_header referer https://wx2.qq.com/;
	    proxy_set_header host wx2.qq.com;
	    proxy_set_header origin https://wx2.qq.com;
        }
   */
  function sendMsg(){
    var LocalID = getLocalID()
    axios.post('/cgi-bin/mmwebwx-bin/webwxsendmsg',{"BaseRequest":{"Uin":1351866013,"Sid":"DEcxwzbgGmCLxiUd","Skey":"@crypt_fed06237_a265d8101608ecf4956d5829e966e058","DeviceID":getDeviceID()},"Msg":{"Type":1,"Content":"青青宝贝","FromUserName":"@1793d9a8f363f0f9e498452acb1020acf13780be388bb35cc9310989647ca983","ToUserName":"@5c7c0a13273f802a409cd1bee2c95ee61eea979119194f44b0af617dea46cee5","LocalID":LocalID,"ClientMsgId":LocalID},"Scene":0},{withCredentials: true})
  }
  // axios.post('/cgi-bin/mmwebwx-bin/webwxsendmsg',{"BaseRequest":{"Uin":1351866013,"Sid":"1PwsOBl5+9+bJYT8","Skey":"@crypt_fed06237_cf942b252f7b53b3a27859dc6efb0b2c","DeviceID":"e478018247934437"},"Msg":{"Type":1,"Content":"1","FromUserName":"@dbf745942a12a3ed95d6e76691d73281c1d351bbaf0d7f7abd0437bee889bb3f","ToUserName":"@329a7eb1dbed5683256bd3e272d85e96c7b133b353220c3f258eb5d51c4321ee","LocalID":"15754527108750938","ClientMsgId":"15754527108750938"},"Scene":0})
</script>
</body>
</html>
